home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2004-08-25 | 73.2 KB | 1,606 lines
' ********************************************************************************************* ' *** ' *** GPS.NET for the PocketPC Example1 ' *** A Complete demonstration of GPS functionality ' *** ' *** For help with your GPS device or programming questions, visit our support center: ' *** ' *** http://www.gpsdotnet.Com/Support ' *** ' *** Support can also be obtained by e-mailing us at: ' *** ' *** support@gpsdotnet.Com ' *** ' *** NOTE: This source code is considered public domain and may be re-used in your own ' *** applications. ' *** ' ********************************************************************************************* Imports System.IO Imports System.Windows.Forms Imports StormSource.Gps Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the Component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) MyBase.Dispose(disposing) End Sub 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents MenuComPort As System.Windows.Forms.MenuItem Friend WithEvents LocalTimeTimer As System.Windows.Forms.Timer Friend WithEvents MenuBaudRate As System.Windows.Forms.MenuItem Friend WithEvents MenuBaudRate4800 As System.Windows.Forms.MenuItem Friend WithEvents MenuBaudRate9600 As System.Windows.Forms.MenuItem Friend WithEvents MenuDataBits As System.Windows.Forms.MenuItem Friend WithEvents MenuDataBits8 As System.Windows.Forms.MenuItem Friend WithEvents MenuDataBits7 As System.Windows.Forms.MenuItem Friend WithEvents MenuParity As System.Windows.Forms.MenuItem Friend WithEvents MenuParityNone As System.Windows.Forms.MenuItem Friend WithEvents MenuParityEven As System.Windows.Forms.MenuItem Friend WithEvents MenuParityOdd As System.Windows.Forms.MenuItem Friend WithEvents MenuParitySpace As System.Windows.Forms.MenuItem Friend WithEvents MenuParityMark As System.Windows.Forms.MenuItem Friend WithEvents MenuStopBits As System.Windows.Forms.MenuItem Friend WithEvents StatusBar As System.Windows.Forms.StatusBar Friend WithEvents FixedSatellites As System.Windows.Forms.Label Friend WithEvents TrackedSatellites As System.Windows.Forms.Label Friend WithEvents ActiveSatellites As System.Windows.Forms.Label Friend WithEvents FixedSatelliteCountLabel As System.Windows.Forms.Label Friend WithEvents TrackedSatelliteCountLabel As System.Windows.Forms.Label Friend WithEvents ActiveSatelliteCountLabel As System.Windows.Forms.Label Friend WithEvents SatelliteList As System.Windows.Forms.ListView Friend WithEvents PRCColumn As System.Windows.Forms.ColumnHeader Friend WithEvents AzimuthColumn As System.Windows.Forms.ColumnHeader Friend WithEvents ElevationColumn As System.Windows.Forms.ColumnHeader Friend WithEvents MagneticVariation As System.Windows.Forms.Label Friend WithEvents MagneticVariationLabel As System.Windows.Forms.Label Friend WithEvents MeanDilutionOfPrecision As System.Windows.Forms.Label Friend WithEvents VerticalDilutionOfPrecision As System.Windows.Forms.Label Friend WithEvents HorizontalDilutionOfPrecision As System.Windows.Forms.Label Friend WithEvents MeanDilutionOfPrecisionLabel As System.Windows.Forms.Label Friend WithEvents VerticalDilutionOfPrecisionLabel As System.Windows.Forms.Label Friend WithEvents HorizontalDilutionOfPrecisionLabel As System.Windows.Forms.Label Friend WithEvents LocalTime As System.Windows.Forms.Label Friend WithEvents UTCDateTime As System.Windows.Forms.Label Friend WithEvents Longitude As System.Windows.Forms.Label Friend WithEvents Latitude As System.Windows.Forms.Label Friend WithEvents Direction As System.Windows.Forms.Label Friend WithEvents DirectionLabel As System.Windows.Forms.Label Friend WithEvents Bearing As System.Windows.Forms.Label Friend WithEvents Speed As System.Windows.Forms.Label Friend WithEvents LocalTimeLabel As System.Windows.Forms.Label Friend WithEvents GPSTimeLabel As System.Windows.Forms.Label Friend WithEvents BearingLabel As System.Windows.Forms.Label Friend WithEvents LongitudeLabel As System.Windows.Forms.Label Friend WithEvents LatitudeLabel As System.Windows.Forms.Label Friend WithEvents SpeedLabel As System.Windows.Forms.Label Friend WithEvents Altitude As System.Windows.Forms.Label Friend WithEvents AltitudeLabel As System.Windows.Forms.Label Friend WithEvents UnrecognizedSentences As System.Windows.Forms.ListBox Friend WithEvents RecognizedSentences As System.Windows.Forms.ListBox Friend WithEvents UnrecognizedSentencesLabel As System.Windows.Forms.Label Friend WithEvents RecognizedSentencesLabel As System.Windows.Forms.Label Friend WithEvents SatelliteTab As System.Windows.Forms.TabPage Friend WithEvents RawDataTab As System.Windows.Forms.TabPage Friend WithEvents LocationTab As System.Windows.Forms.TabPage Friend WithEvents SignalColumn As System.Windows.Forms.ColumnHeader Friend WithEvents TabControl As System.Windows.Forms.TabControl Friend WithEvents MenuStopBits1 As System.Windows.Forms.MenuItem Friend WithEvents MenuStopBits1_5 As System.Windows.Forms.MenuItem Friend WithEvents MenuStopBits2 As System.Windows.Forms.MenuItem Friend WithEvents GPSMenu As System.Windows.Forms.MenuItem Friend WithEvents StartMenu As System.Windows.Forms.MenuItem Friend WithEvents StopMenu As System.Windows.Forms.MenuItem Friend WithEvents MainMenu As System.Windows.Forms.MainMenu Friend WithEvents MenuComPort1 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort2 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort3 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort4 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort5 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort6 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort7 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPort8 As System.Windows.Forms.MenuItem Friend WithEvents MenuComPortAutomatic As System.Windows.Forms.MenuItem Friend WithEvents MenuBaudRateAutomatic As System.Windows.Forms.MenuItem Friend WithEvents MenuSettings As System.Windows.Forms.MenuItem Friend WithEvents MenuSeparator3 As System.Windows.Forms.MenuItem Friend WithEvents MenuSeaprator2 As System.Windows.Forms.MenuItem Friend WithEvents MenuSeparator1 As System.Windows.Forms.MenuItem Private Sub InitializeComponent() Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem1 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem2 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem3 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem4 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem2 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem5 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem6 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem7 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem8 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem3 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem9 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem10 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem11 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem12 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem4 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem13 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem14 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem15 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem16 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem5 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem17 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem18 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem19 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem20 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem6 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem21 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem22 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem23 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem24 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem7 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem25 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem26 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem27 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem28 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem8 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem29 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem30 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem31 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem32 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem9 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem33 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem34 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem35 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem36 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem10 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem37 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem38 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem39 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem40 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem11 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem41 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem42 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem43 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem44 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem12 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem45 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem46 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem47 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem48 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem13 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem49 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem50 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem51 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem52 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem14 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem53 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem54 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem55 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem56 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem15 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem57 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem58 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem59 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem60 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewItem16 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem Dim ListViewSubItem61 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem62 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem63 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Dim ListViewSubItem64 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem Me.MainMenu = New System.Windows.Forms.MainMenu Me.GPSMenu = New System.Windows.Forms.MenuItem Me.MenuSettings = New System.Windows.Forms.MenuItem Me.MenuComPort = New System.Windows.Forms.MenuItem Me.MenuComPortAutomatic = New System.Windows.Forms.MenuItem Me.MenuSeparator3 = New System.Windows.Forms.MenuItem Me.MenuComPort1 = New System.Windows.Forms.MenuItem Me.MenuComPort2 = New System.Windows.Forms.MenuItem Me.MenuComPort3 = New System.Windows.Forms.MenuItem Me.MenuComPort4 = New System.Windows.Forms.MenuItem Me.MenuComPort5 = New System.Windows.Forms.MenuItem Me.MenuComPort6 = New System.Windows.Forms.MenuItem Me.MenuComPort7 = New System.Windows.Forms.MenuItem Me.MenuComPort8 = New System.Windows.Forms.MenuItem Me.MenuBaudRate = New System.Windows.Forms.MenuItem Me.MenuBaudRateAutomatic = New System.Windows.Forms.MenuItem Me.MenuSeaprator2 = New System.Windows.Forms.MenuItem Me.MenuBaudRate4800 = New System.Windows.Forms.MenuItem Me.MenuBaudRate9600 = New System.Windows.Forms.MenuItem Me.MenuDataBits = New System.Windows.Forms.MenuItem Me.MenuDataBits8 = New System.Windows.Forms.MenuItem Me.MenuDataBits7 = New System.Windows.Forms.MenuItem Me.MenuStopBits = New System.Windows.Forms.MenuItem Me.MenuStopBits1 = New System.Windows.Forms.MenuItem Me.MenuStopBits1_5 = New System.Windows.Forms.MenuItem Me.MenuStopBits2 = New System.Windows.Forms.MenuItem Me.MenuParity = New System.Windows.Forms.MenuItem Me.MenuParityNone = New System.Windows.Forms.MenuItem Me.MenuParityEven = New System.Windows.Forms.MenuItem Me.MenuParityOdd = New System.Windows.Forms.MenuItem Me.MenuParitySpace = New System.Windows.Forms.MenuItem Me.MenuParityMark = New System.Windows.Forms.MenuItem Me.MenuSeparator1 = New System.Windows.Forms.MenuItem Me.StartMenu = New System.Windows.Forms.MenuItem Me.StopMenu = New System.Windows.Forms.MenuItem Me.LocalTimeTimer = New System.Windows.Forms.Timer Me.StatusBar = New System.Windows.Forms.StatusBar Me.TabControl = New System.Windows.Forms.TabControl Me.LocationTab = New System.Windows.Forms.TabPage Me.MagneticVariation = New System.Windows.Forms.Label Me.MagneticVariationLabel = New System.Windows.Forms.Label Me.MeanDilutionOfPrecision = New System.Windows.Forms.Label Me.VerticalDilutionOfPrecision = New System.Windows.Forms.Label Me.HorizontalDilutionOfPrecision = New System.Windows.Forms.Label Me.MeanDilutionOfPrecisionLabel = New System.Windows.Forms.Label Me.VerticalDilutionOfPrecisionLabel = New System.Windows.Forms.Label Me.HorizontalDilutionOfPrecisionLabel = New System.Windows.Forms.Label Me.LocalTime = New System.Windows.Forms.Label Me.UTCDateTime = New System.Windows.Forms.Label Me.Longitude = New System.Windows.Forms.Label Me.Latitude = New System.Windows.Forms.Label Me.Direction = New System.Windows.Forms.Label Me.DirectionLabel = New System.Windows.Forms.Label Me.Bearing = New System.Windows.Forms.Label Me.Speed = New System.Windows.Forms.Label Me.LocalTimeLabel = New System.Windows.Forms.Label Me.GPSTimeLabel = New System.Windows.Forms.Label Me.BearingLabel = New System.Windows.Forms.Label Me.LongitudeLabel = New System.Windows.Forms.Label Me.LatitudeLabel = New System.Windows.Forms.Label Me.SpeedLabel = New System.Windows.Forms.Label Me.Altitude = New System.Windows.Forms.Label Me.AltitudeLabel = New System.Windows.Forms.Label Me.SatelliteTab = New System.Windows.Forms.TabPage Me.FixedSatellites = New System.Windows.Forms.Label Me.TrackedSatellites = New System.Windows.Forms.Label Me.ActiveSatellites = New System.Windows.Forms.Label Me.FixedSatelliteCountLabel = New System.Windows.Forms.Label Me.TrackedSatelliteCountLabel = New System.Windows.Forms.Label Me.ActiveSatelliteCountLabel = New System.Windows.Forms.Label Me.SatelliteList = New System.Windows.Forms.ListView Me.PRCColumn = New System.Windows.Forms.ColumnHeader Me.AzimuthColumn = New System.Windows.Forms.ColumnHeader Me.ElevationColumn = New System.Windows.Forms.ColumnHeader Me.SignalColumn = New System.Windows.Forms.ColumnHeader Me.RawDataTab = New System.Windows.Forms.TabPage Me.UnrecognizedSentences = New System.Windows.Forms.ListBox Me.RecognizedSentences = New System.Windows.Forms.ListBox Me.UnrecognizedSentencesLabel = New System.Windows.Forms.Label Me.RecognizedSentencesLabel = New System.Windows.Forms.Label ' 'MainMenu ' Me.MainMenu.MenuItems.Add(Me.GPSMenu) ' 'GPSMenu ' Me.GPSMenu.MenuItems.Add(Me.MenuSettings) Me.GPSMenu.MenuItems.Add(Me.MenuSeparator1) Me.GPSMenu.MenuItems.Add(Me.StartMenu) Me.GPSMenu.MenuItems.Add(Me.StopMenu) Me.GPSMenu.Text = "GPS" ' 'MenuSettings ' Me.MenuSettings.MenuItems.Add(Me.MenuComPort) Me.MenuSettings.MenuItems.Add(Me.MenuBaudRate) Me.MenuSettings.MenuItems.Add(Me.MenuDataBits) Me.MenuSettings.MenuItems.Add(Me.MenuStopBits) Me.MenuSettings.MenuItems.Add(Me.MenuParity) Me.MenuSettings.Text = "Settings" ' 'MenuComPort ' Me.MenuComPort.MenuItems.Add(Me.MenuComPortAutomatic) Me.MenuComPort.MenuItems.Add(Me.MenuSeparator3) Me.MenuComPort.MenuItems.Add(Me.MenuComPort1) Me.MenuComPort.MenuItems.Add(Me.MenuComPort2) Me.MenuComPort.MenuItems.Add(Me.MenuComPort3) Me.MenuComPort.MenuItems.Add(Me.MenuComPort4) Me.MenuComPort.MenuItems.Add(Me.MenuComPort5) Me.MenuComPort.MenuItems.Add(Me.MenuComPort6) Me.MenuComPort.MenuItems.Add(Me.MenuComPort7) Me.MenuComPort.MenuItems.Add(Me.MenuComPort8) Me.MenuComPort.Text = "Com Port" ' 'MenuComPortAutomatic ' Me.MenuComPortAutomatic.Text = "Automatic" ' 'MenuSeparator3 ' Me.MenuSeparator3.Text = "-" ' 'MenuComPort1 ' Me.MenuComPort1.Text = "Com1" ' 'MenuComPort2 ' Me.MenuComPort2.Text = "Com2" ' 'MenuComPort3 ' Me.MenuComPort3.Text = "Com3" ' 'MenuComPort4 ' Me.MenuComPort4.Text = "Com4" ' 'MenuComPort5 ' Me.MenuComPort5.Text = "Com5" ' 'MenuComPort6 ' Me.MenuComPort6.Text = "Com6" ' 'MenuComPort7 ' Me.MenuComPort7.Text = "Com7" ' 'MenuComPort8 ' Me.MenuComPort8.Text = "Com8" ' 'MenuBaudRate ' Me.MenuBaudRate.MenuItems.Add(Me.MenuBaudRateAutomatic) Me.MenuBaudRate.MenuItems.Add(Me.MenuSeaprator2) Me.MenuBaudRate.MenuItems.Add(Me.MenuBaudRate4800) Me.MenuBaudRate.MenuItems.Add(Me.MenuBaudRate9600) Me.MenuBaudRate.Text = "Baud Rate" ' 'MenuBaudRateAutomatic ' Me.MenuBaudRateAutomatic.Text = "Automatic" ' 'MenuSeaprator2 ' Me.MenuSeaprator2.Text = "-" ' 'MenuBaudRate4800 ' Me.MenuBaudRate4800.Text = "4800" ' 'MenuBaudRate9600 ' Me.MenuBaudRate9600.Text = "9600" ' 'MenuDataBits ' Me.MenuDataBits.MenuItems.Add(Me.MenuDataBits8) Me.MenuDataBits.MenuItems.Add(Me.MenuDataBits7) Me.MenuDataBits.Text = "Data Bits" ' 'MenuDataBits8 ' Me.MenuDataBits8.Text = "8" ' 'MenuDataBits7 ' Me.MenuDataBits7.Text = "7" ' 'MenuStopBits ' Me.MenuStopBits.MenuItems.Add(Me.MenuStopBits1) Me.MenuStopBits.MenuItems.Add(Me.MenuStopBits1_5) Me.MenuStopBits.MenuItems.Add(Me.MenuStopBits2) Me.MenuStopBits.Text = "Stop Bits" ' 'MenuStopBits1 ' Me.MenuStopBits1.Text = "1" ' 'MenuStopBits1_5 ' Me.MenuStopBits1_5.Text = "1.5" ' 'MenuStopBits2 ' Me.MenuStopBits2.Text = "2" ' 'MenuParity ' Me.MenuParity.MenuItems.Add(Me.MenuParityNone) Me.MenuParity.MenuItems.Add(Me.MenuParityEven) Me.MenuParity.MenuItems.Add(Me.MenuParityOdd) Me.MenuParity.MenuItems.Add(Me.MenuParitySpace) Me.MenuParity.MenuItems.Add(Me.MenuParityMark) Me.MenuParity.Text = "Parity" ' 'MenuParityNone ' Me.MenuParityNone.Text = "None" ' 'MenuParityEven ' Me.MenuParityEven.Text = "Even" ' 'MenuParityOdd ' Me.MenuParityOdd.Text = "Odd" ' 'MenuParitySpace ' Me.MenuParitySpace.Text = "Space" ' 'MenuParityMark ' Me.MenuParityMark.Text = "Mark" ' 'MenuSeparator1 ' Me.MenuSeparator1.Text = "-" ' 'StartMenu ' Me.StartMenu.Text = "Start" ' 'StopMenu ' Me.StopMenu.Enabled = False Me.StopMenu.Text = "Stop" ' 'LocalTimeTimer ' Me.LocalTimeTimer.Enabled = True Me.LocalTimeTimer.Interval = 500 ' 'StatusBar ' Me.StatusBar.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.StatusBar.Location = New System.Drawing.Point(0, 248) Me.StatusBar.Size = New System.Drawing.Size(249, 30) Me.StatusBar.Text = "Ready." ' 'TabControl ' Me.TabControl.Controls.Add(Me.LocationTab) Me.TabControl.Controls.Add(Me.SatelliteTab) Me.TabControl.Controls.Add(Me.RawDataTab) Me.TabControl.SelectedIndex = 0 Me.TabControl.Size = New System.Drawing.Size(249, 246) ' 'LocationTab ' Me.LocationTab.Controls.Add(Me.MagneticVariation) Me.LocationTab.Controls.Add(Me.MagneticVariationLabel) Me.LocationTab.Controls.Add(Me.MeanDilutionOfPrecision) Me.LocationTab.Controls.Add(Me.VerticalDilutionOfPrecision) Me.LocationTab.Controls.Add(Me.HorizontalDilutionOfPrecision) Me.LocationTab.Controls.Add(Me.MeanDilutionOfPrecisionLabel) Me.LocationTab.Controls.Add(Me.VerticalDilutionOfPrecisionLabel) Me.LocationTab.Controls.Add(Me.HorizontalDilutionOfPrecisionLabel) Me.LocationTab.Controls.Add(Me.LocalTime) Me.LocationTab.Controls.Add(Me.UTCDateTime) Me.LocationTab.Controls.Add(Me.Longitude) Me.LocationTab.Controls.Add(Me.Latitude) Me.LocationTab.Controls.Add(Me.Direction) Me.LocationTab.Controls.Add(Me.DirectionLabel) Me.LocationTab.Controls.Add(Me.Bearing) Me.LocationTab.Controls.Add(Me.Speed) Me.LocationTab.Controls.Add(Me.LocalTimeLabel) Me.LocationTab.Controls.Add(Me.GPSTimeLabel) Me.LocationTab.Controls.Add(Me.BearingLabel) Me.LocationTab.Controls.Add(Me.LongitudeLabel) Me.LocationTab.Controls.Add(Me.LatitudeLabel) Me.LocationTab.Controls.Add(Me.SpeedLabel) Me.LocationTab.Controls.Add(Me.Altitude) Me.LocationTab.Controls.Add(Me.AltitudeLabel) Me.LocationTab.Location = New System.Drawing.Point(4, 4) Me.LocationTab.Size = New System.Drawing.Size(241, 220) Me.LocationTab.Text = "Location" ' 'MagneticVariation ' Me.MagneticVariation.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.MagneticVariation.Location = New System.Drawing.Point(102, 201) Me.MagneticVariation.Size = New System.Drawing.Size(135, 15) Me.MagneticVariation.Text = "..." ' 'MagneticVariationLabel ' Me.MagneticVariationLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.MagneticVariationLabel.Location = New System.Drawing.Point(3, 201) Me.MagneticVariationLabel.Size = New System.Drawing.Size(93, 15) Me.MagneticVariationLabel.Text = "Magnetic Var.:" ' 'MeanDilutionOfPrecision ' Me.MeanDilutionOfPrecision.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.MeanDilutionOfPrecision.Location = New System.Drawing.Point(102, 147) Me.MeanDilutionOfPrecision.Size = New System.Drawing.Size(135, 15) Me.MeanDilutionOfPrecision.Text = "..." ' 'VerticalDilutionOfPrecision ' Me.VerticalDilutionOfPrecision.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.VerticalDilutionOfPrecision.Location = New System.Drawing.Point(102, 183) Me.VerticalDilutionOfPrecision.Size = New System.Drawing.Size(135, 15) Me.VerticalDilutionOfPrecision.Text = "..." ' 'HorizontalDilutionOfPrecision ' Me.HorizontalDilutionOfPrecision.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.HorizontalDilutionOfPrecision.Location = New System.Drawing.Point(102, 165) Me.HorizontalDilutionOfPrecision.Size = New System.Drawing.Size(135, 15) Me.HorizontalDilutionOfPrecision.Text = "..." ' 'MeanDilutionOfPrecisionLabel ' Me.MeanDilutionOfPrecisionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.MeanDilutionOfPrecisionLabel.Location = New System.Drawing.Point(3, 147) Me.MeanDilutionOfPrecisionLabel.Size = New System.Drawing.Size(93, 15) Me.MeanDilutionOfPrecisionLabel.Text = "Position DOP:" ' 'VerticalDilutionOfPrecisionLabel ' Me.VerticalDilutionOfPrecisionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.VerticalDilutionOfPrecisionLabel.Location = New System.Drawing.Point(3, 183) Me.VerticalDilutionOfPrecisionLabel.Size = New System.Drawing.Size(93, 15) Me.VerticalDilutionOfPrecisionLabel.Text = "Vertical DOP:" ' 'HorizontalDilutionOfPrecisionLabel ' Me.HorizontalDilutionOfPrecisionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.HorizontalDilutionOfPrecisionLabel.Location = New System.Drawing.Point(3, 165) Me.HorizontalDilutionOfPrecisionLabel.Size = New System.Drawing.Size(93, 15) Me.HorizontalDilutionOfPrecisionLabel.Text = "Horizontal DOP:" ' 'LocalTime ' Me.LocalTime.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.LocalTime.Location = New System.Drawing.Point(102, 129) Me.LocalTime.Size = New System.Drawing.Size(135, 15) Me.LocalTime.Text = "..." ' 'UTCDateTime ' Me.UTCDateTime.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.UTCDateTime.Location = New System.Drawing.Point(102, 111) Me.UTCDateTime.Size = New System.Drawing.Size(135, 15) Me.UTCDateTime.Text = "..." ' 'Longitude ' Me.Longitude.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.Longitude.Location = New System.Drawing.Point(102, 93) Me.Longitude.Size = New System.Drawing.Size(135, 15) Me.Longitude.Text = "..." ' 'Latitude ' Me.Latitude.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.Latitude.Location = New System.Drawing.Point(102, 75) Me.Latitude.Size = New System.Drawing.Size(135, 15) Me.Latitude.Text = "..." ' 'Direction ' Me.Direction.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.Direction.Location = New System.Drawing.Point(102, 57) Me.Direction.Size = New System.Drawing.Size(135, 15) Me.Direction.Text = "..." ' 'DirectionLabel ' Me.DirectionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.DirectionLabel.Location = New System.Drawing.Point(3, 57) Me.DirectionLabel.Size = New System.Drawing.Size(93, 15) Me.DirectionLabel.Text = "Direction:" ' 'Bearing ' Me.Bearing.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.Bearing.Location = New System.Drawing.Point(102, 39) Me.Bearing.Size = New System.Drawing.Size(135, 15) Me.Bearing.Text = "..." ' 'Speed ' Me.Speed.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.Speed.Location = New System.Drawing.Point(102, 21) Me.Speed.Size = New System.Drawing.Size(135, 15) Me.Speed.Text = "..." ' 'LocalTimeLabel ' Me.LocalTimeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.LocalTimeLabel.Location = New System.Drawing.Point(3, 129) Me.LocalTimeLabel.Size = New System.Drawing.Size(93, 15) Me.LocalTimeLabel.Text = "Local Time:" ' 'GPSTimeLabel ' Me.GPSTimeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.GPSTimeLabel.Location = New System.Drawing.Point(3, 111) Me.GPSTimeLabel.Size = New System.Drawing.Size(93, 15) Me.GPSTimeLabel.Text = "GPS Time:" ' 'BearingLabel ' Me.BearingLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.BearingLabel.Location = New System.Drawing.Point(3, 39) Me.BearingLabel.Size = New System.Drawing.Size(93, 15) Me.BearingLabel.Text = "Bearing:" ' 'LongitudeLabel ' Me.LongitudeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.LongitudeLabel.Location = New System.Drawing.Point(3, 93) Me.LongitudeLabel.Size = New System.Drawing.Size(93, 15) Me.LongitudeLabel.Text = "Longitude:" ' 'LatitudeLabel ' Me.LatitudeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.LatitudeLabel.Location = New System.Drawing.Point(3, 75) Me.LatitudeLabel.Size = New System.Drawing.Size(93, 15) Me.LatitudeLabel.Text = "Latitude:" ' 'SpeedLabel ' Me.SpeedLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.SpeedLabel.Location = New System.Drawing.Point(3, 21) Me.SpeedLabel.Size = New System.Drawing.Size(93, 15) Me.SpeedLabel.Text = "Speed:" ' 'Altitude ' Me.Altitude.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.Altitude.Location = New System.Drawing.Point(102, 3) Me.Altitude.Size = New System.Drawing.Size(135, 15) Me.Altitude.Text = "..." ' 'AltitudeLabel ' Me.AltitudeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.AltitudeLabel.Location = New System.Drawing.Point(3, 3) Me.AltitudeLabel.Size = New System.Drawing.Size(93, 15) Me.AltitudeLabel.Text = "Altitude:" ' 'SatelliteTab ' Me.SatelliteTab.Controls.Add(Me.FixedSatellites) Me.SatelliteTab.Controls.Add(Me.TrackedSatellites) Me.SatelliteTab.Controls.Add(Me.ActiveSatellites) Me.SatelliteTab.Controls.Add(Me.FixedSatelliteCountLabel) Me.SatelliteTab.Controls.Add(Me.TrackedSatelliteCountLabel) Me.SatelliteTab.Controls.Add(Me.ActiveSatelliteCountLabel) Me.SatelliteTab.Controls.Add(Me.SatelliteList) Me.SatelliteTab.Location = New System.Drawing.Point(4, 4) Me.SatelliteTab.Size = New System.Drawing.Size(241, 220) Me.SatelliteTab.Text = "Satellites" ' 'FixedSatellites ' Me.FixedSatellites.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.FixedSatellites.Location = New System.Drawing.Point(177, 3) Me.FixedSatellites.Size = New System.Drawing.Size(45, 18) Me.FixedSatellites.Text = "0" ' 'TrackedSatellites ' Me.TrackedSatellites.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.TrackedSatellites.Location = New System.Drawing.Point(117, 3) Me.TrackedSatellites.Size = New System.Drawing.Size(24, 18) Me.TrackedSatellites.Text = "0" ' 'ActiveSatellites ' Me.ActiveSatellites.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.ActiveSatellites.Location = New System.Drawing.Point(45, 3) Me.ActiveSatellites.Size = New System.Drawing.Size(24, 18) Me.ActiveSatellites.Text = "0" ' 'FixedSatelliteCountLabel ' Me.FixedSatelliteCountLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.FixedSatelliteCountLabel.Location = New System.Drawing.Point(141, 3) Me.FixedSatelliteCountLabel.Size = New System.Drawing.Size(36, 18) Me.FixedSatelliteCountLabel.Text = "Fixed:" ' 'TrackedSatelliteCountLabel ' Me.TrackedSatelliteCountLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.TrackedSatelliteCountLabel.Location = New System.Drawing.Point(69, 3) Me.TrackedSatelliteCountLabel.Size = New System.Drawing.Size(48, 18) Me.TrackedSatelliteCountLabel.Text = "Tracked:" ' 'ActiveSatelliteCountLabel ' Me.ActiveSatelliteCountLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular) Me.ActiveSatelliteCountLabel.Location = New System.Drawing.Point(6, 3) Me.ActiveSatelliteCountLabel.Size = New System.Drawing.Size(39, 18) Me.ActiveSatelliteCountLabel.Text = "Active:" ' 'SatelliteList ' Me.SatelliteList.CheckBoxes = True Me.SatelliteList.Columns.Add(Me.PRCColumn) Me.SatelliteList.Columns.Add(Me.AzimuthColumn) Me.SatelliteList.Columns.Add(Me.ElevationColumn) Me.SatelliteList.Columns.Add(Me.SignalColumn) Me.SatelliteList.FullRowSelect = True ListViewSubItem1.Text = "" ListViewSubItem2.Text = "" ListViewSubItem3.Text = "" ListViewSubItem4.Text = "" ListViewItem1.SubItems.Add(ListViewSubItem1) ListViewItem1.SubItems.Add(ListViewSubItem2) ListViewItem1.SubItems.Add(ListViewSubItem3) ListViewItem1.SubItems.Add(ListViewSubItem4) ListViewItem1.Text = "" ListViewSubItem5.Text = "" ListViewSubItem6.Text = "" ListViewSubItem7.Text = "" ListViewSubItem8.Text = "" ListViewItem2.SubItems.Add(ListViewSubItem5) ListViewItem2.SubItems.Add(ListViewSubItem6) ListViewItem2.SubItems.Add(ListViewSubItem7) ListViewItem2.SubItems.Add(ListViewSubItem8) ListViewItem2.Text = "" ListViewSubItem9.Text = "" ListViewSubItem10.Text = "" ListViewSubItem11.Text = "" ListViewSubItem12.Text = "" ListViewItem3.SubItems.Add(ListViewSubItem9) ListViewItem3.SubItems.Add(ListViewSubItem10) ListViewItem3.SubItems.Add(ListViewSubItem11) ListViewItem3.SubItems.Add(ListViewSubItem12) ListViewItem3.Text = "" ListViewSubItem13.Text = "" ListViewSubItem14.Text = "" ListViewSubItem15.Text = "" ListViewSubItem16.Text = "" ListViewItem4.SubItems.Add(ListViewSubItem13) ListViewItem4.SubItems.Add(ListViewSubItem14) ListViewItem4.SubItems.Add(ListViewSubItem15) ListViewItem4.SubItems.Add(ListViewSubItem16) ListViewItem4.Text = "" ListViewSubItem17.Text = "" ListViewSubItem18.Text = "" ListViewSubItem19.Text = "" ListViewSubItem20.Text = "" ListViewItem5.SubItems.Add(ListViewSubItem17) ListViewItem5.SubItems.Add(ListViewSubItem18) ListViewItem5.SubItems.Add(ListViewSubItem19) ListViewItem5.SubItems.Add(ListViewSubItem20) ListViewItem5.Text = "" ListViewSubItem21.Text = "" ListViewSubItem22.Text = "" ListViewSubItem23.Text = "" ListViewSubItem24.Text = "" ListViewItem6.SubItems.Add(ListViewSubItem21) ListViewItem6.SubItems.Add(ListViewSubItem22) ListViewItem6.SubItems.Add(ListViewSubItem23) ListViewItem6.SubItems.Add(ListViewSubItem24) ListViewItem6.Text = "" ListViewSubItem25.Text = "" ListViewSubItem26.Text = "" ListViewSubItem27.Text = "" ListViewSubItem28.Text = "" ListViewItem7.SubItems.Add(ListViewSubItem25) ListViewItem7.SubItems.Add(ListViewSubItem26) ListViewItem7.SubItems.Add(ListViewSubItem27) ListViewItem7.SubItems.Add(ListViewSubItem28) ListViewItem7.Text = "" ListViewSubItem29.Text = "" ListViewSubItem30.Text = "" ListViewSubItem31.Text = "" ListViewSubItem32.Text = "" ListViewItem8.SubItems.Add(ListViewSubItem29) ListViewItem8.SubItems.Add(ListViewSubItem30) ListViewItem8.SubItems.Add(ListViewSubItem31) ListViewItem8.SubItems.Add(ListViewSubItem32) ListViewItem8.Text = "" ListViewSubItem33.Text = "" ListViewSubItem34.Text = "" ListViewSubItem35.Text = "" ListViewSubItem36.Text = "" ListViewItem9.SubItems.Add(ListViewSubItem33) ListViewItem9.SubItems.Add(ListViewSubItem34) ListViewItem9.SubItems.Add(ListViewSubItem35) ListViewItem9.SubItems.Add(ListViewSubItem36) ListViewItem9.Text = "" ListViewSubItem37.Text = "" ListViewSubItem38.Text = "" ListViewSubItem39.Text = "" ListViewSubItem40.Text = "" ListViewItem10.SubItems.Add(ListViewSubItem37) ListViewItem10.SubItems.Add(ListViewSubItem38) ListViewItem10.SubItems.Add(ListViewSubItem39) ListViewItem10.SubItems.Add(ListViewSubItem40) ListViewItem10.Text = "" ListViewSubItem41.Text = "" ListViewSubItem42.Text = "" ListViewSubItem43.Text = "" ListViewSubItem44.Text = "" ListViewItem11.SubItems.Add(ListViewSubItem41) ListViewItem11.SubItems.Add(ListViewSubItem42) ListViewItem11.SubItems.Add(ListViewSubItem43) ListViewItem11.SubItems.Add(ListViewSubItem44) ListViewItem11.Text = "" ListViewSubItem45.Text = "" ListViewSubItem46.Text = "" ListViewSubItem47.Text = "" ListViewSubItem48.Text = "" ListViewItem12.SubItems.Add(ListViewSubItem45) ListViewItem12.SubItems.Add(ListViewSubItem46) ListViewItem12.SubItems.Add(ListViewSubItem47) ListViewItem12.SubItems.Add(ListViewSubItem48) ListViewItem12.Text = "" ListViewSubItem49.Text = "" ListViewSubItem50.Text = "" ListViewSubItem51.Text = "" ListViewSubItem52.Text = "" ListViewItem13.SubItems.Add(ListViewSubItem49) ListViewItem13.SubItems.Add(ListViewSubItem50) ListViewItem13.SubItems.Add(ListViewSubItem51) ListViewItem13.SubItems.Add(ListViewSubItem52) ListViewItem13.Text = "" ListViewSubItem53.Text = "" ListViewSubItem54.Text = "" ListViewSubItem55.Text = "" ListViewSubItem56.Text = "" ListViewItem14.SubItems.Add(ListViewSubItem53) ListViewItem14.SubItems.Add(ListViewSubItem54) ListViewItem14.SubItems.Add(ListViewSubItem55) ListViewItem14.SubItems.Add(ListViewSubItem56) ListViewItem14.Text = "" ListViewSubItem57.Text = "" ListViewSubItem58.Text = "" ListViewSubItem59.Text = "" ListViewSubItem60.Text = "" ListViewItem15.SubItems.Add(ListViewSubItem57) ListViewItem15.SubItems.Add(ListViewSubItem58) ListViewItem15.SubItems.Add(ListViewSubItem59) ListViewItem15.SubItems.Add(ListViewSubItem60) ListViewItem15.Text = "" ListViewSubItem61.Text = "" ListViewSubItem62.Text = "" ListViewSubItem63.Text = "" ListViewSubItem64.Text = "" ListViewItem16.SubItems.Add(ListViewSubItem61) ListViewItem16.SubItems.Add(ListViewSubItem62) ListViewItem16.SubItems.Add(ListViewSubItem63) ListViewItem16.SubItems.Add(ListViewSubItem64) ListViewItem16.Text = "" Me.SatelliteList.Items.Add(ListViewItem1) Me.SatelliteList.Items.Add(ListViewItem2) Me.SatelliteList.Items.Add(ListViewItem3) Me.SatelliteList.Items.Add(ListViewItem4) Me.SatelliteList.Items.Add(ListViewItem5) Me.SatelliteList.Items.Add(ListViewItem6) Me.SatelliteList.Items.Add(ListViewItem7) Me.SatelliteList.Items.Add(ListViewItem8) Me.SatelliteList.Items.Add(ListViewItem9) Me.SatelliteList.Items.Add(ListViewItem10) Me.SatelliteList.Items.Add(ListViewItem11) Me.SatelliteList.Items.Add(ListViewItem12) Me.SatelliteList.Items.Add(ListViewItem13) Me.SatelliteList.Items.Add(ListViewItem14) Me.SatelliteList.Items.Add(ListViewItem15) Me.SatelliteList.Items.Add(ListViewItem16) Me.SatelliteList.Location = New System.Drawing.Point(3, 21) Me.SatelliteList.Size = New System.Drawing.Size(235, 198) Me.SatelliteList.View = System.Windows.Forms.View.Details ' 'PRCColumn ' Me.PRCColumn.Text = "PRC" Me.PRCColumn.Width = 35 ' 'AzimuthColumn ' Me.AzimuthColumn.Text = "Azimuth" Me.AzimuthColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center Me.AzimuthColumn.Width = 55 ' 'ElevationColumn ' Me.ElevationColumn.Text = "Elevation" Me.ElevationColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center Me.ElevationColumn.Width = 56 ' 'SignalColumn ' Me.SignalColumn.Text = "Signal" Me.SignalColumn.Width = 73 ' 'RawDataTab ' Me.RawDataTab.Controls.Add(Me.UnrecognizedSentences) Me.RawDataTab.Controls.Add(Me.RecognizedSentences) Me.RawDataTab.Controls.Add(Me.UnrecognizedSentencesLabel) Me.RawDataTab.Controls.Add(Me.RecognizedSentencesLabel) Me.RawDataTab.Location = New System.Drawing.Point(4, 4) Me.RawDataTab.Size = New System.Drawing.Size(241, 220) Me.RawDataTab.Text = "Data" ' 'UnrecognizedSentences ' Me.UnrecognizedSentences.Location = New System.Drawing.Point(3, 174) Me.UnrecognizedSentences.Size = New System.Drawing.Size(234, 44) ' 'RecognizedSentences ' Me.RecognizedSentences.Location = New System.Drawing.Point(3, 21) Me.RecognizedSentences.Size = New System.Drawing.Size(234, 128) ' 'UnrecognizedSentencesLabel ' Me.UnrecognizedSentencesLabel.Location = New System.Drawing.Point(3, 156) Me.UnrecognizedSentencesLabel.Size = New System.Drawing.Size(159, 18) Me.UnrecognizedSentencesLabel.Text = "Unrecognized Sentences:" ' 'RecognizedSentencesLabel ' Me.RecognizedSentencesLabel.Location = New System.Drawing.Point(3, 3) Me.RecognizedSentencesLabel.Size = New System.Drawing.Size(138, 18) Me.RecognizedSentencesLabel.Text = "Recognized Sentences:" ' 'Form1 ' Me.ClientSize = New System.Drawing.Size(249, 278) Me.Controls.Add(Me.TabControl) Me.Controls.Add(Me.StatusBar) Me.Menu = Me.MainMenu Me.Text = "GPS.NET Demo" End Sub #End Region Private WithEvents GPS As New Receiver #Region " (Miscellaneous form code, does not include GPS demonstration code) " ' Stores information about current activity going on with the GPS device Public CurrentStatus As String ' Used to update the status bar Public Sub UpdateStatusBar(ByVal sender As Object, ByVal e As EventArgs) StatusBar.Text = CurrentStatus ' Let the user interface update System.Windows.Forms.Application.DoEvents() End Sub ' Raised when the application is closing Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing ' Shut down GPS communications GPS.Stop() ' Dispose of unmanaged resources LocalTimeTimer.Dispose() GPS.Dispose() End Sub ' Raised when the form is first initialized Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Load in previsouly-saved serial port settings ReadSettings() ' Override the font of the ListView (which cannot be set at design time!) SatelliteList.Font = New Font("Tahoma", 8, FontStyle.Regular) End Sub ' Raised when one of the Com ports menus is selected Private Sub MenuComPort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuComPortAutomatic.Click, MenuComPort1.Click, MenuComPort2.Click, MenuComPort3.Click, MenuComPort4.Click, MenuComPort5.Click, MenuComPort6.Click, MenuComPort7.Click, MenuComPort8.Click ' Set the Com port to the fourth character of the menu, converted to an integer Dim SelectedMenuItem As MenuItem = sender If SelectedMenuItem.Text = "Automatic" Then GPS.Device.Settings.ComPort = ComPort.Automatic Else GPS.Device.Settings.ComPort = CType(SelectedMenuItem.Text.Substring(3), Integer) End If ' Save this setting SaveSettings() ' Update the checkboxes for each Com port menu item Dim MenuComPort As MenuItem For Each MenuComPort In SelectedMenuItem.Parent.MenuItems ' Check the item if its text matches that of the selected item MenuComPort.Checked = (MenuComPort.Text = SelectedMenuItem.Text) Next End Sub ' Raised when one of the baud rate menus is selected Private Sub MenuBaudRate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuBaudRateAutomatic.Click, MenuBaudRate4800.Click, MenuBaudRate9600.Click ' Set the Com port to the fourth character of the menu, converted to an integer Dim SelectedMenuItem As MenuItem = sender If SelectedMenuItem.Text = "Automatic" Then GPS.Device.Settings.BaudRate = BaudRate.Automatic Else GPS.Device.Settings.BaudRate = CType(SelectedMenuItem.Text, Integer) End If ' Save this setting SaveSettings() ' Update the checkboxes for each Com port menu item Dim MenuComPort As MenuItem For Each MenuComPort In SelectedMenuItem.Parent.MenuItems ' Check the item if its text matches that of the selected item MenuComPort.Checked = (MenuComPort.Text = SelectedMenuItem.Text) Next End Sub ' Raised when one of the parity menus is selected Private Sub MenuParity_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuParityNone.Click, MenuParityEven.Click, MenuParityOdd.Click, MenuParityMark.Click, MenuParitySpace.Click ' Set the Com port to the fourth character of the menu, converted to an integer Dim SelectedMenuItem As MenuItem = sender Select Case SelectedMenuItem.Text Case "None" GPS.Device.Settings.Parity = Parity.None Case "Even" GPS.Device.Settings.Parity = Parity.Even Case "Odd" GPS.Device.Settings.Parity = Parity.Odd Case "Mark" GPS.Device.Settings.Parity = Parity.Mark Case "Space" GPS.Device.Settings.Parity = Parity.Space End Select ' Save this setting SaveSettings() ' Update the checkboxes for each Com port menu item Dim MenuParity As MenuItem For Each MenuParity In SelectedMenuItem.Parent.MenuItems ' Check the item if its text matches that of the selected item MenuParity.Checked = (MenuParity.Text = SelectedMenuItem.Text) Next End Sub ' Raised when one of the stop bit menus is selected Private Sub MenuStopBits_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuStopBits1.Click, MenuStopBits1_5.Click, MenuStopBits2.Click ' Set the Com port to the fourth character of the menu, converted to an integer Dim SelectedMenuItem As MenuItem = sender GPS.Device.Settings.StopBits = SelectedMenuItem.Text ' Save this setting SaveSettings() ' Update the checkboxes for each Com port menu item Dim MenuStopBits As MenuItem For Each MenuStopBits In SelectedMenuItem.Parent.MenuItems ' Check the item if its text matches that of the selected item MenuStopBits.Checked = (MenuStopBits.Text = SelectedMenuItem.Text) Next End Sub ' Raised when one of the data bit menus is selected Private Sub MenuDataBits_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuDataBits8.Click, MenuDataBits7.Click ' Set the Com port to the fourth character of the menu, converted to an integer Dim SelectedMenuItem As MenuItem = sender GPS.Device.Settings.DataBits = SelectedMenuItem.Text ' Save this setting SaveSettings() ' Update the checkboxes for each Com port menu item Dim MenuDataBits As MenuItem For Each MenuDataBits In SelectedMenuItem.Parent.MenuItems ' Check the item if its text matches that of the selected item MenuDataBits.Checked = (MenuDataBits.Text = SelectedMenuItem.Text) Next End Sub #End Region #Region " Methods which load and save Com port settings to a file " ' Reads previous serial port settings Private Sub ReadSettings() Try ' If a settings file does not exist, make one If Not System.IO.File.Exists("Settings.txt") Then SaveSettings() ' Read in the settings Dim SettingsFile As StreamReader = New StreamReader("Settings.txt") ' Read the serial port settings Dim Settings As String = SettingsFile.ReadLine ' Close the file SettingsFile.Close() ' Split the settings into an array Dim Values(4) As String Values = Settings.Split(",") ' And apply the settings GPS.Device.Settings.ComPort = Values(0) GPS.Device.Settings.BaudRate = Values(1) GPS.Device.Settings.DataBits = Values(2) GPS.Device.Settings.Parity = Values(3) GPS.Device.Settings.StopBits = Values(4) ' Check the appropriate Com port menu Select Case GPS.Device.Settings.ComPort Case ComPort.Automatic MenuComPortAutomatic.Checked = True Case ComPort.COM1 MenuComPort1.Checked = True Case ComPort.COM2 MenuComPort2.Checked = True Case ComPort.COM3 MenuComPort3.Checked = True Case ComPort.COM4 MenuComPort4.Checked = True Case ComPort.COM5 MenuComPort5.Checked = True Case ComPort.COM6 MenuComPort6.Checked = True Case ComPort.COM7 MenuComPort7.Checked = True Case ComPort.COM8 MenuComPort8.Checked = True End Select ' Check the appropriate baud rate menu Select Case GPS.Device.Settings.BaudRate Case BaudRate.Automatic MenuBaudRateAutomatic.Checked = True Case BaudRate.Baud4800 MenuBaudRate4800.Checked = True Case BaudRate.Baud9600 MenuBaudRate9600.Checked = True End Select ' Check the appropriate data bits menu Select Case GPS.Device.Settings.DataBits Case DataBit.Size7 MenuDataBits7.Checked = True Case DataBit.Size8 MenuDataBits8.Checked = True End Select ' Check the appropriate parity menu Select Case GPS.Device.Settings.Parity Case Parity.Even MenuParityEven.Checked = True Case Parity.Mark MenuParityMark.Checked = True Case Parity.None MenuParityNone.Checked = True Case Parity.Odd MenuParityOdd.Checked = True Case Parity.Space MenuParitySpace.Checked = True End Select ' Check the appropriate stop bit menu Select Case GPS.Device.Settings.StopBits Case StopBit.Bit1 MenuStopBits1.Checked = True Case StopBit.Bit1Point5 MenuStopBits1_5.Checked = True Case StopBit.Bit2 MenuStopBits2.Checked = True End Select Catch ex As NullReferenceException ' This happens if the settings file is empty. Correct the file by rewriting it. SaveSettings() Catch ex As Exception ' File error (most likely, settings file does not exist) Throw ex End Try End Sub ' Writes the serial port settings to a little text file Private Sub SaveSettings() Dim SettingsFile As StreamWriter = New StreamWriter("Settings.txt") ' Write the serial port settings SettingsFile.WriteLine(CType(GPS.Device.Settings.ComPort, Integer) & "," _ & CType(GPS.Device.Settings.BaudRate, Integer) & "," _ & CType(GPS.Device.Settings.DataBits, Integer) & "," _ & CType(GPS.Device.Settings.Parity, Integer) & "," _ & CType(GPS.Device.Settings.StopBits, Integer)) SettingsFile.Close() End Sub #End Region #Region " Demonstration of Starting and Stopping GPS Communications " ' Raised when the "Start" menu is clicked from the "GPS" menu Private Sub StartMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartMenu.Click Try ' Set the license key (visit http://www.gpsdotnet.com/purchase for pricing and secure online ordering) ' GPS.SetLicenseKey("[your license key]") ' For speed, tell Automatic Device Discovery to use detected device ' information from the registry. GPS.Device.DetectionMode = DeviceDetectionMode.UsePreviouslyDetectedDevices ' Uncomment the following line to perform detection once per session (slower, but recommended) 'GPS.Device.DetectionMode = DeviceDetectionMode.DetectOncePerSession ' Start GPS communications GPS.Start() ' Enable the disconnect menu StartMenu.Enabled = False StopMenu.Enabled = True Catch ex As GpsException MessageBox.Show(ex.Message, "Cannot Connect", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) Catch ex As Exception Stop End Try End Sub ' Raised when the "Stop" menu is clicked from the "GPS" menu Private Sub StopMenu_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles StopMenu.Click GPS.Stop() ' Re-enable the Start menu item StartMenu.Enabled = True StopMenu.Enabled = False End Sub ' Raised when a connection is being attempted Private Sub GPS_Connecting(ByVal sender As Object, ByVal e As DeviceSettingsEventArgs) Handles GPS.Connecting CurrentStatus = "Connecting to GPS device on " & e.DeviceSettings.ComPort.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub ' Raised when a connection is being attempted Private Sub GPS_Connected(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.Connected CurrentStatus = "Connected to GPS device, waiting for reply..." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub ' Raised when a connection is being attempted Private Sub GPS_Disconnecting(ByVal sender As Object, ByVal e As DeviceSettingsEventArgs) Handles GPS.Disconnecting CurrentStatus = "Disconnecting from GPS device on " & e.DeviceSettings.ComPort.ToString & "..." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub ' Raised when Communications with the GPS device were successfully stopped Private Sub GPS_Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.Disconnected ' The connection to the serial port has been closed CurrentStatus = "Disconnected from GPS device." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub #End Region #Region " Demonstration of Raw Data Processing " ' Stores information about the current sentence Private CurrentSentence As String ' Returns True if the sentence was fully understood Private CurrentSentenceType As SentenceType ' Adds the specified sentence to the list Private Sub AddSentence(ByVal sender As Object, ByVal e As EventArgs) Select Case CurrentSentenceType Case SentenceType.Recognized ' The sentence was processed successfully RecognizedSentences.Items.Add(CurrentSentence) RecognizedSentences.SelectedIndex = RecognizedSentences.Items.Count - 1 ' Prevent too many lines from being in the list box If RecognizedSentences.Items.Count > 20 Then RecognizedSentences.Items.RemoveAt(0) Case SentenceType.Unrecognized ' The sentence contained some corrupt data, or was proprietary to a specific device UnrecognizedSentences.Items.Add(CurrentSentence) UnrecognizedSentences.SelectedIndex = UnrecognizedSentences.Items.Count - 1 ' Prevent too many lines from being in the list box If UnrecognizedSentences.Items.Count > 20 Then UnrecognizedSentences.Items.RemoveAt(0) End Select End Sub ' Raised when a sentence has been received from the GPS device Private Sub GPS_SentenceReceived(ByVal sender As Object, ByVal e As SentenceEventArgs) Handles GPS.SentenceReceived CurrentSentence = e.Sentence CurrentSentenceType = e.Type ' Add the sentence to the appropriate ListBox in the "Data" tab Invoke(New EventHandler(AddressOf AddSentence)) End Sub #End Region #Region " Demonstration of Satellite-Related GPS Events " ' Updates a satellite's information on the form Private Sub UpdateSatelliteCounts(ByVal sender As Object, ByVal e As EventArgs) ' The active count (the number of satellites reporting any information) ActiveSatellites.Text = GPS.Satellites.ActiveCount ' The tracked count (the number of satellites with a detectable signal) TrackedSatellites.Text = GPS.Satellites.TrackedCount ' The tracked count (the number of satellites being used to calculate your location) FixedSatellites.Text = GPS.Satellites.FixedCount End Sub ' Updates all satellite information Private Sub UpdateSatellites(ByVal sender As Object, ByVal e As EventArgs) Dim Satellite As Satellite ' Iterate through each known satellite For Each Satellite In GPS.Satellites ' And update its information UpdateSatellite(Satellite) Next End Sub ' Updates a satellite's information on the form Private Sub UpdateSatellite(ByVal Satellite As Satellite) ' Update the current satellite pseudo-random code SatelliteList.Items(Satellite.Index).Text = Satellite.PseudoRandomCode ' Update the current satellite elevation SatelliteList.Items(Satellite.Index).SubItems(1).Text = Satellite.Elevation.ToString ' Update the current satellite azimuth SatelliteList.Items(Satellite.Index).SubItems(2).Text = Satellite.Azimuth.ToString ' Update the signal strength for this satellite SatelliteList.Items(Satellite.Index).SubItems(3).Text = Satellite.SignalToNoiseRatio.ToString & " (" & Satellite.SignalToNoiseRatio.Rating.ToString & ")" ' Mark this item as checked if the satellite is involved in an active fix SatelliteList.Items(Satellite.Index).Checked = Satellite.IsFixObtained End Sub ' Raised when the horizontal angle (around the horizon) of a GPS satellite has changed Private Sub GPS_SatelliteAzimuthChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteAzimuthChanged ' Update the status to show that the azimuth has changed CurrentStatus = "Satellite " & e.Satellite.PseudoRandomCode & " azimuth has changed to " & e.Satellite.Elevation.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update this satellite's information Invoke(New EventHandler(AddressOf UpdateSatellites)) End Sub ' Raised when the vertical angle (up from the horizon) of a GPS satellite has changed Private Sub GPS_SatelliteElevationChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteElevationChanged ' Update the status to show that the elevation has changed CurrentStatus = "Satellite " & e.Satellite.PseudoRandomCode & " elevation has changed to " & e.Satellite.Elevation.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update this satellite's information Invoke(New EventHandler(AddressOf UpdateSatellites)) End Sub ' Raised when a satellite which previously was involved in a fix, has lost the fix Private Sub GPS_SatelliteFixLost(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteFixLost ' Update this satellite's information Invoke(New EventHandler(AddressOf UpdateSatellites)) End Sub ' Raised when a satellite is now being used to calculate your location Private Sub GPS_SatelliteFixObtained(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteFixObtained ' Update this satellite's information Invoke(New EventHandler(AddressOf UpdateSatellites)) End Sub ' Raised when the unique code for a satellite beComes known Private Sub GPS_SatellitePRCChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatellitePseudoRandomCodeChanged ' Update this satellite's information Invoke(New EventHandler(AddressOf UpdateSatellites)) End Sub ' Raised when the signal strength from a GPS satellite has changed Private Sub GPS_SatelliteSignalToNoiseRatioChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteSignalToNoiseRatioChanged ' Update the current status to show the change in signal strength CurrentStatus = "Satellite " & e.Satellite.PseudoRandomCode & " signal has changed to " & e.Satellite.SignalToNoiseRatio.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update this satellite's information Invoke(New EventHandler(AddressOf UpdateSatellites)) End Sub ' Handles three events: SatelliteActiveCountChanged, SatelliteFixCountChanged, SatelliteTrackedCountChanged Private Sub GPS_SatelliteCountChanged(ByVal sender As Object, ByVal e As SatelliteCountEventArgs) Handles GPS.SatelliteActiveCountChanged, GPS.SatelliteFixedCountChanged, GPS.SatelliteTrackedCountChanged ' Update the satellite counts Invoke(New EventHandler(AddressOf UpdateSatelliteCounts)) End Sub #End Region #Region " Demonstration of Motion-Related Events " ' Updates the current speed Private Sub UpdateSpeed(ByVal sender As Object, ByVal e As EventArgs) ' NOTE: Change "ToStatuteMilesPerHour" to "ToKilometersPerHour" for non-USA measurements Speed.Text = GPS.Speed.ToStatuteMilesPerHour.ToString End Sub ' Updates the current altitude Private Sub UpdateAltitude(ByVal sender As Object, ByVal e As EventArgs) ' NOTE: Change "ToFeet" to "ToMeters" for non-USA measurements Altitude.Text = GPS.Altitude.ToFeet.ToString End Sub ' Updates the current bearing Private Sub UpdateBearing(ByVal sender As Object, ByVal e As EventArgs) ' Update the bearing Bearing.Text = GPS.Bearing.ToString ' And show the current bearing represented as a cardinal (Compass) direction Direction.Text = GPS.Bearing.CardinalDirection.ToString End Sub ' Updates the current location Private Sub UpdatePosition(ByVal sender As Object, ByVal e As EventArgs) ' Update the current latitude Latitude.Text = GPS.Position.Latitude.ToString ' Update the longitude Longitude.Text = GPS.Position.Longitude.ToString End Sub ' Updates the current magnetic variation Private Sub UpdateMagneticVariation(ByVal sender As Object, ByVal e As EventArgs) MagneticVariation.Text = GPS.MagneticVariation.ToString End Sub ' Raised when the current speed has changed Private Sub GPS_SpeedChanged(ByVal sender As Object, ByVal e As SpeedEventArgs) Handles GPS.SpeedChanged ' Update the status to show the change in speed CurrentStatus = "The current speed has changed to " & e.Speed.ToStatuteMilesPerHour.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the rate of travel Invoke(New EventHandler(AddressOf UpdateSpeed)) End Sub ' Raised when the current altitude has changed Private Sub GPS_AltitudeChanged(ByVal sender As Object, ByVal e As DistanceEventArgs) Handles GPS.AltitudeChanged ' Change "ToFeet" to "ToMeters" for Metric measurements CurrentStatus = "Altitude has changed to " & e.Distance.ToFeet.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the current height above sea level Invoke(New EventHandler(AddressOf UpdateAltitude)) End Sub ' Raised when the current direction of travel changes Private Sub GPS_BearingChanged(ByVal sender As Object, ByVal e As AzimuthEventArgs) Handles GPS.BearingChanged ' Display the cardinal direction with degree angle in parenthesis CurrentStatus = "Heading " & e.Azimuth.CardinalDirection.ToString & " (" & e.Azimuth.ToString & ")" Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the direction of travel Invoke(New EventHandler(AddressOf UpdateBearing)) End Sub ' Raised when the current latitude or longitude has changed Private Sub GPS_PositionChanged(ByVal sender As Object, ByVal e As PositionEventArgs) Handles GPS.PositionChanged ' Set the status to show that the location has changed CurrentStatus = "Your current location has changed." Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the current location Invoke(New EventHandler(AddressOf UpdatePosition)) End Sub ' Raised when the magnetic variation beComes known Private Sub GPS_MagneticVariationChanged(ByVal sender As Object, ByVal e As LongitudeEventArgs) Handles GPS.MagneticVariationChanged CurrentStatus = "Magnetic variation is now known." Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the current location Invoke(New EventHandler(AddressOf UpdateMagneticVariation)) End Sub #End Region #Region " Demonstration of Precision-Related Events " ' Updates the form with dilution of precision (accuracy) information Private Sub UpdateMeanDilutionOfPrecision(ByVal sender As Object, ByVal e As EventArgs) ' Update the overall (mean) accuracy MeanDilutionOfPrecision.Text = GPS.MeanDilutionOfPrecision.ToString End Sub ' Updates the form with dilution of precision (accuracy) information Private Sub UpdateHorizontalDilutionOfPrecision(ByVal sender As Object, ByVal e As EventArgs) ' Update the accuract of latitude/longitude measurements HorizontalDilutionOfPrecision.Text = GPS.HorizontalDilutionOfPrecision.ToString End Sub ' Updates the form with dilution of precision (accuracy) information Private Sub UpdateVerticalDilutionOfPrecision(ByVal sender As Object, ByVal e As EventArgs) ' Update the accuracy of altitude measurements VerticalDilutionOfPrecision.Text = GPS.VerticalDilutionOfPrecision.ToString End Sub ' Raised when the accuracy of latitude/longitude measurements has changed Private Sub GPS_HorizontalDilutionOfPrecisionChanged(ByVal sender As Object, ByVal e As DilutionOfPrecisionEventArgs) Handles GPS.HorizontalDilutionOfPrecisionChanged CurrentStatus = "Lat/long accuracy has changed to " & e.DilutionOfPrecision.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the accuracy information Invoke(New EventHandler(AddressOf UpdateHorizontalDilutionOfPrecision)) End Sub ' Raised when the mean accuracy in the current latitude/longitude has changed Private Sub GPS_MeanDilutionOfPrecisionChanged(ByVal sender As Object, ByVal e As DilutionOfPrecisionEventArgs) Handles GPS.MeanDilutionOfPrecisionChanged CurrentStatus = "General accuracy has changed to " & e.DilutionOfPrecision.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the accuracy information Invoke(New EventHandler(AddressOf UpdateMeanDilutionOfPrecision)) End Sub ' Raised when the confidence level of altitude measurements has changed Private Sub GPS_VerticalDilutionOfPrecisionChanged(ByVal sender As Object, ByVal e As DilutionOfPrecisionEventArgs) Handles GPS.VerticalDilutionOfPrecisionChanged CurrentStatus = "Altitude accuracy has changed to " & e.DilutionOfPrecision.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) ' Update the accuracy information Invoke(New EventHandler(AddressOf UpdateVerticalDilutionOfPrecision)) End Sub #End Region #Region " Demonstration of Satellite Fix-Related Events " ' Raised when a trilateration solution is no longer available Private Sub GPS_FixLost(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.FixLost CurrentStatus = "The satellite fix has been lost." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub ' Raised when at least three satellites are able to calculate the current location Private Sub GPS_FixObtained(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.FixObtained CurrentStatus = "A satellite fix has been acquired!" Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub ' Raised when the fix changes from satellite-only to differential GPS (satellites plus ground stations) Private Sub GPS_FixQualityChanged(ByVal sender As Object, ByVal e As FixQualityEventArgs) Handles GPS.FixQualityChanged CurrentStatus = "The fix quality has changed." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub Private Sub GPS_FixMethodChanged(ByVal sender As Object, ByVal e As StormSource.Gps.FixMethodEventArgs) Handles GPS.FixMethodChanged CurrentStatus = "GPS fix method has changed to " & e.FixMethod.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub Private Sub GPS_FixModeChanged(ByVal sender As Object, ByVal e As StormSource.Gps.FixModeEventArgs) Handles GPS.FixModeChanged CurrentStatus = "GPS fix mode has changed to " & e.FixMode.ToString Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub #End Region #Region " Demonstration of Handling GPS Errors " ' Raised when an error has been encountered while trying to process GPS data Private Sub GPS_ErrorOccurred(ByVal sender As Object, ByVal e As ErrorEventArgs) Handles GPS.ErrorOccurred CurrentStatus = e.Exception.Message Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub #End Region #Region " Demonstration of Time-Related Events " ' Updates the form with local date/time information Public Sub UpdateLocalTime(ByVal sender As Object, ByVal e As EventArgs) LocalTime.Text = Now.ToString End Sub ' Updates the form with local date/time information Public Sub UpdateGPSTime(ByVal sender As Object, ByVal e As EventArgs) UTCDateTime.Text = GPS.UtcDateTime.ToLocalTime.ToString End Sub ' Updates the local PocketPC time for Comparison to GPS satellite-based time Private Sub LocalTimeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LocalTimeTimer.Tick Invoke(New EventHandler(AddressOf UpdateLocalTime)) End Sub ' Raised when the date/time indicated by GPS satellites has changed Private Sub GPS_UTCDateTimeChanged(ByVal sender As Object, ByVal e As DateTimeEventArgs) Handles GPS.UtcDateTimeChanged Invoke(New EventHandler(AddressOf UpdateGPSTime)) End Sub #End Region #Region " Demonstration of Automatic Device Detection " ' GPS.NET is able to search for and detect GPS devices connected to the device. ' This feature is recommended because it virtually removes the need to train your ' users on what serial ports are, and also removes the need to troubleshoot customers ' which do not know their correct serial port settings. ' ' To use device detection, set the Receiver.Device.Settings.ComPort property to ' ComPort.Automatic. You can also use the DeviceSettingsDetector class to make your ' own device detection features. Private Sub GPS_DeviceDetectionStarted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.DeviceDetectionStarted ' Update the status to show that the azimuth has changed CurrentStatus = "Please wait, detecting GPS devices..." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub Private Sub GPS_DeviceDetectionCompleted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.DeviceDetectionCompleted ' Update the status to show that the azimuth has changed CurrentStatus = "GPS device detection has completed." Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub Private Sub GPS_DeviceDetected(ByVal sender As Object, ByVal e As StormSource.Gps.DeviceSettingsEventArgs) Handles GPS.DeviceDetected ' Update the status to show that the azimuth has changed CurrentStatus = "A GPS device was found on " & e.DeviceSettings.ComPort.ToString & "!" Invoke(New EventHandler(AddressOf UpdateStatusBar)) End Sub #End Region End Class